﻿using CKS2320.Common.Model;
using CKS2320.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;

namespace CKS2320.Controller.Common.Utils
{
    public static class StringUtils
    {
        public static string GetSetting(string opIP, PLCRunTypeEnum runType, PLCDataType dataType, DataSetting _setting)
        {
            var option = GetRunType(opIP, _setting);
            if (option != null)
            {
                switch (dataType)
                {
                    case PLCDataType.BHVerticalityJudge:
                        if (runType == PLCRunTypeEnum.A)
                            return option.BHVerticalityJudge_A;
                        else
                            return option.BHVerticalityJudge_B;
                    case PLCDataType.SHVerticalityJudge:
                        if (runType == PLCRunTypeEnum.A)
                            return option.SHVerticalityJudge_A;
                        else
                            return option.SHVerticalityJudge_B;
                    case PLCDataType.StartUpload:
                        if (runType == PLCRunTypeEnum.A)
                            return option.StartUpLoad_AOffset;
                        else
                            return option.StartUpLoad_BOffset;

                    case PLCDataType.TotalLengthResult:
                        if (runType == PLCRunTypeEnum.A)
                            return option.TotalLengthResult_AOffset;
                        else
                            return option.TotalLengthResult_BOffset;
                    case PLCDataType.VoltageWithstandResultAC:
                        if (runType == PLCRunTypeEnum.A)
                            return option.VoltageWithstandResult_AOffsetAC;
                        else
                            return option.VoltageWithstandResult_BOffsetAC;
                    case PLCDataType.EndUpLoad:
                        if (runType == PLCRunTypeEnum.A)
                            return option.EndUpLoad_AOffset;
                        else
                            return option.EndUpLoad_BOffset;

                    case PLCDataType.PartCode:
                        if (runType == PLCRunTypeEnum.A)
                            return option.PartCode_AOffset;
                        else
                            return option.PartCode_BOffset;

                    case PLCDataType.PartCodeTrigger:
                        if (runType == PLCRunTypeEnum.A)
                            return option.PartCodeTrigger_AOffset;
                        else
                            return option.PartCodeTrigger_BOffset;

                    case PLCDataType.PartCodeResult:
                        if (runType == PLCRunTypeEnum.A)
                            return option.PartCodeResult_AOffset;
                        else
                            return option.PartCodeResult_BOffset;

                    case PLCDataType.Result:
                        if (runType == PLCRunTypeEnum.A)
                            return option.Result_AOffset;
                        else
                            return option.Result_BOffset;

                    case PLCDataType.Heart1:
                        return option.Heart1Offset;
                    case PLCDataType.Heart2:
                        return option.Heart2Offset;

                    case PLCDataType.DetectionDataStart:
                        if (runType == PLCRunTypeEnum.A)
                            return option.DetectionDataStart_AOffset;
                        else
                            return option.DetectionDataStart_BOffset;

                    case PLCDataType.VoltageWithstandResult:
                        if (runType == PLCRunTypeEnum.A)
                            return option.VoltageWithstandResult_AOffset;
                        else
                            return option.VoltageWithstandResult_BOffset;

                    case PLCDataType.CameraDetectionResult:
                        if (runType == PLCRunTypeEnum.A)
                            return option.CameraDetectionResult_AOffset;
                        else
                            return option.CameraDetectionResult_BOffset;

                    case PLCDataType.StartKeyenceOffset:
                        if (runType == PLCRunTypeEnum.A)
                            return option.StartKeyence_AOffset;
                        else
                            return option.StartKeyence_BOffset;

                    case PLCDataType.EndKeyenceOffset:
                        if (runType == PLCRunTypeEnum.A)
                            return option.EndKeyence_AOffset;
                        else
                            return option.EndKeyence_BOffset;

                    //case PLCDataType.TotalLengthResult:
                    //    if (runType == PLCRunTypeEnum.A)
                    //        return option.TotalLengthResult_AOffset;
                    //    else
                    //        return option.TotalLengthResult_BOffset;

                    case PLCDataType.CrsmallEndDistanceResult:
                        if (runType == PLCRunTypeEnum.A)
                            return option.CrsmallEndDistanceResult_AOffset;
                        else
                            return option.CrsmallEndDistanceResult_BOffset;

                    case PLCDataType.CrlargeEndDistanceResult:
                        if (runType == PLCRunTypeEnum.A)
                            return option.CrlargeEndDistanceResult_AOffset;
                        else
                            return option.CrlargeEndDistanceResult_BOffset;

                    case PLCDataType.Crfront1WaveDistanceResult:
                        if (runType == PLCRunTypeEnum.A)
                            return option.Crfront1WaveDistanceResult_AOffset;
                        else
                            return option.Crfront1WaveDistanceResult_BOffset;

                    case PLCDataType.Crfront64WaveDistanceResult:
                        if (runType == PLCRunTypeEnum.A)
                            return option.Crfront64WaveDistanceResult_AOffset;
                        else
                            return option.Crfront64WaveDistanceResult_BOffset;

                    case PLCDataType.FrontThicknessResult1:
                        if (runType == PLCRunTypeEnum.A)
                            return option.FrontThicknessResult1_AOffset;
                        else
                            return option.FrontThicknessResult1_BOffset;
                    case PLCDataType.FrontThicknessResult2:
                        if (runType == PLCRunTypeEnum.A)
                            return option.FrontThicknessResult2_AOffset;
                        else
                            return option.FrontThicknessResult2_BOffset;
                    case PLCDataType.FrontThicknessResult3:
                        if (runType == PLCRunTypeEnum.A)
                            return option.FrontThicknessResult3_AOffset;
                        else
                            return option.FrontThicknessResult3_BOffset;
                    case PLCDataType.FrontThicknessResult4:
                        if (runType == PLCRunTypeEnum.A)
                            return option.FrontThicknessResult4_AOffset;
                        else
                            return option.FrontThicknessResult4_BOffset;
                    case PLCDataType.FrontThicknessResult5:
                        if (runType == PLCRunTypeEnum.A)
                            return option.FrontThicknessResult5_AOffset;
                        else
                            return option.FrontThicknessResult5_BOffset;
                    case PLCDataType.FrontThicknessResult6:
                        if (runType == PLCRunTypeEnum.A)
                            return option.FrontThicknessResult6_AOffset;
                        else
                            return option.FrontThicknessResult6_BOffset;
                    case PLCDataType.FrontThicknessResult7:
                        if (runType == PLCRunTypeEnum.A)
                            return option.FrontThicknessResult7_AOffset;
                        else
                            return option.FrontThicknessResult7_BOffset;
                    case PLCDataType.BackThicknessResult1:
                        if (runType == PLCRunTypeEnum.A)
                            return option.BackThicknessResult1_AOffset;
                        else
                            return option.BackThicknessResult1_BOffset;
                    case PLCDataType.BackThicknessResult2:
                        if (runType == PLCRunTypeEnum.A)
                            return option.BackThicknessResult2_AOffset;
                        else
                            return option.BackThicknessResult2_BOffset;
                    case PLCDataType.BackThicknessResult3:
                        if (runType == PLCRunTypeEnum.A)
                            return option.BackThicknessResult3_AOffset;
                        else
                            return option.BackThicknessResult3_BOffset;
                    case PLCDataType.BackThicknessResult4:
                        if (runType == PLCRunTypeEnum.A)
                            return option.BackThicknessResult4_AOffset;
                        else
                            return option.BackThicknessResult4_BOffset;
                    case PLCDataType.BackThicknessResult5:
                        if (runType == PLCRunTypeEnum.A)
                            return option.BackThicknessResult5_AOffset;
                        else
                            return option.BackThicknessResult5_BOffset;
                    case PLCDataType.BackThicknessResult6:
                        if (runType == PLCRunTypeEnum.A)
                            return option.BackThicknessResult6_AOffset;
                        else
                            return option.BackThicknessResult6_BOffset;
                    case PLCDataType.BackThicknessResult7:
                        if (runType == PLCRunTypeEnum.A)
                            return option.BackThicknessResult7_AOffset;
                        else
                            return option.BackThicknessResult7_BOffset;
                    case PLCDataType.SmallEndDirectionInspectionResult:
                        if (runType == PLCRunTypeEnum.A)
                            return option.SmallEndDirectionInspectionResult_AOffset;
                        else
                            return option.SmallEndDirectionInspectionResult_BOffset;
                    case PLCDataType.FacadeCurvatureResult:
                        if (runType == PLCRunTypeEnum.A)
                            return option.FacadeCurvatureResult_AOffset;
                        else
                            return option.FacadeCurvatureResult_BOffset;
                    case PLCDataType.KeyenceResult:
                        if (runType == PLCRunTypeEnum.A)
                            return option.KeyenceResult_AOffset;
                        else
                            return option.KeyenceResult_BOffset;
                    case PLCDataType.ReadyKeyence:
                        if (runType == PLCRunTypeEnum.A)
                            return option.ReadyKeyence_AOffset;
                        else
                            return option.ReadyKeyence_BOffset;
                    case PLCDataType.Directioncheck:
                        if (runType == PLCRunTypeEnum.A)
                            return option.DirectioncheckA;
                        else
                            return option.DirectioncheckB;
                    case PLCDataType.EndKeyence3d:
                        if (runType == PLCRunTypeEnum.A)
                            return option.EndKeyence3dA;
                        else
                            return option.EndKeyence3dB;
                    case PLCDataType.FinishSave:
                        if (runType == PLCRunTypeEnum.A)
                            return option.FinishSaveA;
                        else
                            return option.FinishSaveB;
                    case PLCDataType.SC01Value:
                        if (runType == PLCRunTypeEnum.A)
                            return option.SC01ValueA;
                        else
                            return option.SC01ValueB;
                    case PLCDataType.SC02Value:
                        if (runType == PLCRunTypeEnum.A)
                            return option.SC02ValueA;
                        else
                            return option.SC02ValueB;
                    case PLCDataType.SC03Value:
                        if (runType == PLCRunTypeEnum.A)
                            return option.SC03ValueA;
                        else
                            return option.SC03ValueB;
                    case PLCDataType.SC04Value:
                        if (runType == PLCRunTypeEnum.A)
                            return option.SC04ValueA;
                        else
                            return option.SC04ValueB;
                    case PLCDataType.SendScValueOk:
                        if (runType == PLCRunTypeEnum.A)
                            return option.SendScValueOkA;
                        else
                            return option.SendScValueOkB;
                }
            }
            return "";
        }

        public static dynamic? GetRunType(string opIP, DataSetting _setting)
        {
            if (opIP == PLCOPEnum.OP10.GetDescription())
            {
                return _setting.op10Json;
            }
            if (opIP == PLCOPEnum.OP20.GetDescription())
            {
                return _setting.op20Json;
            }
            if (opIP == PLCOPEnum.OP30.GetDescription())
            {
                return _setting.op30Json;
            }
            return null;
        }

        public static Dictionary<string, int> GetDataType(string opIP)
        {
            Dictionary<string, int> detectionTypeList = new();
            if (opIP == PLCOPEnum.OP10.GetDescription())
            {
                detectionTypeList.Add("BOW", 1);
                detectionTypeList.Add("BOh1", 2);
                detectionTypeList.Add("BOh2", 2);
                detectionTypeList.Add("BOh3", 2);
                detectionTypeList.Add("BOh4", 2);
                detectionTypeList.Add("BOh5", 2);
                detectionTypeList.Add("BOh6", 2);
                detectionTypeList.Add("BOh7", 2);
                detectionTypeList.Add("BOh8", 2);
                detectionTypeList.Add("BOh9", 2);
                detectionTypeList.Add("BOh10", 2);
                detectionTypeList.Add("BOh11", 2);
                detectionTypeList.Add("BOh12", 2);
                detectionTypeList.Add("BOh13", 2);
                detectionTypeList.Add("BOh14", 2);
                detectionTypeList.Add("BOh15", 2);
                detectionTypeList.Add("BOh16", 2);
                detectionTypeList.Add("BOh17", 2);
                detectionTypeList.Add("BOh18", 2);
                detectionTypeList.Add("BOh19", 2);
                detectionTypeList.Add("BOh20", 2);
                detectionTypeList.Add("BOh21", 2);
                detectionTypeList.Add("BOh22", 2);
                detectionTypeList.Add("BOh23", 2);
                detectionTypeList.Add("BOh24", 2);
                detectionTypeList.Add("BOh25", 2);
                detectionTypeList.Add("BOh26", 2);
                detectionTypeList.Add("BOh27", 2);
                detectionTypeList.Add("BOh28", 2);
                detectionTypeList.Add("BOh29", 2);
                detectionTypeList.Add("BOh30", 2);
                detectionTypeList.Add("BOh31", 2);
                detectionTypeList.Add("BOh32", 2);
                detectionTypeList.Add("BOh33", 2);
                detectionTypeList.Add("BOh34", 2);
                detectionTypeList.Add("BOh35", 2);
                detectionTypeList.Add("BOh36", 2);
                detectionTypeList.Add("BOh37", 2);
                detectionTypeList.Add("BOh38", 2);
                detectionTypeList.Add("BOh39", 2);
                detectionTypeList.Add("BOh40", 2);
                detectionTypeList.Add("BOh41", 2);
                detectionTypeList.Add("BOh42", 2);
                detectionTypeList.Add("BOh43", 2);
                detectionTypeList.Add("BOh44", 2);
                detectionTypeList.Add("BOh45", 2);
                detectionTypeList.Add("BOh46", 2);
                detectionTypeList.Add("BOh47", 2);
                detectionTypeList.Add("BOh48", 2);
                detectionTypeList.Add("BOh49", 2);
                detectionTypeList.Add("BOh50", 2);
                detectionTypeList.Add("BOh51", 2);
                detectionTypeList.Add("BOh52", 2);
                detectionTypeList.Add("BOh53", 2);
                detectionTypeList.Add("BOh54", 2);
                detectionTypeList.Add("BOh55", 2);
                detectionTypeList.Add("BOh56", 2);
                detectionTypeList.Add("BOh57", 2);
                detectionTypeList.Add("BOh58", 2);
                detectionTypeList.Add("BOh59", 2);
                detectionTypeList.Add("BOh60", 2);
                detectionTypeList.Add("BOh61", 2);
                detectionTypeList.Add("BOh62", 2);
                detectionTypeList.Add("BOh63", 2);
                detectionTypeList.Add("BOh64", 2);
                detectionTypeList.Add("BOh65", 2);
                detectionTypeList.Add("BOh66", 2);
                detectionTypeList.Add("BOh67", 2);
                detectionTypeList.Add("BOh68", 2);
                detectionTypeList.Add("BOh69", 2);
                detectionTypeList.Add("BOh70", 2);
                detectionTypeList.Add("BOh71", 2);
                detectionTypeList.Add("BOh72", 2);
                detectionTypeList.Add("BOh73", 2);
                detectionTypeList.Add("BOh74", 2);
                detectionTypeList.Add("BOh75", 2);
                //detectionTypeList.Add("水平扭曲度", 2);
            }
            if (opIP == PLCOPEnum.OP20.GetDescription())
            {
                detectionTypeList.Add("ACv", 3);
                detectionTypeList.Add("ACa", 4);
                detectionTypeList.Add("DCv", 5);
                detectionTypeList.Add("DCa", 6);
                detectionTypeList.Add("ACdate", 0);
                detectionTypeList.Add("DCdate", 0);
                // detectionTypeList.Add("耐压测试", 7);
                detectionTypeList.Add("residual1", 8);//内孔残留
                detectionTypeList.Add("residual2", 8);
                detectionTypeList.Add("Bsize", 9);//大端尺寸
                detectionTypeList.Add("Bpe", 10);//大端垂直度
                detectionTypeList.Add("Ssize1", 11);//小端尺寸
                detectionTypeList.Add("Sszie2", 11);//小端尺寸
                detectionTypeList.Add("Spe", 12);//小端垂直度
                detectionTypeList.Add("BSresidue", 13);//大端单面残留
                detectionTypeList.Add("TL", 14);
            }
            if (opIP == PLCOPEnum.OP30.GetDescription())
            {

                detectionTypeList.Add("CSDPLC", 15);//C基准-小端距离
                detectionTypeList.Add("CBDPLC", 16);//"C基准-大端距离
                detectionTypeList.Add("CFFPLC", 17);//C基准-正面1波距离
                detectionTypeList.Add("CFLPLC", 18);//C基准-正面64波距离"
                detectionTypeList.Add("SEDPLC", 20);//小末端方向检查
                detectionTypeList.Add("FCT1", 21);
                detectionTypeList.Add("FCT2", 21);
                detectionTypeList.Add("FCT3", 21);
                detectionTypeList.Add("FCT4", 21);
                detectionTypeList.Add("FCT5", 21);
                detectionTypeList.Add("FCT6", 21);
                detectionTypeList.Add("FCT7", 21);
                detectionTypeList.Add("BCT1", 22);
                detectionTypeList.Add("BCT2", 22);
                detectionTypeList.Add("BCT3", 22);
                detectionTypeList.Add("BCT4", 22);
                detectionTypeList.Add("BCT5", 22);
                detectionTypeList.Add("BCT6", 22);
                detectionTypeList.Add("BCT7", 22);
                detectionTypeList.Add("Cam", 23);
                detectionTypeList.Add("OP30TL", 24);
            }
            return detectionTypeList;
        }

        public static string GetDataDisPlay(string content)
        {
            string result = string.Empty;
            switch (content)
            {
                case "residual1":
                case "residual2":
                    result = "residual"; break;
                case "Ssize1":
                case "Ssize2":
                    result = "Ssize"; break;
                case "FCT1":
                case "FCT2":
                case "FCT3":
                case "FCT4":
                case "FCT5":
                case "FCT6":
                case "FCT7":
                    result = "FCT"; break;
                case "BCT1":
                case "BCT2":
                case "BCT3":
                case "BCT4":
                case "BCT5":
                case "BCT6":
                case "BCT7":
                    result = "BCT"; break;
                case "BOh1":
                case "BOh2":
                case "BOh3":
                case "BOh4":
                case "BOh5":
                case "BOh6":
                case "BOh7":
                case "BOh8":
                case "BOh9":
                case "BOh10":
                case "BOh11":
                case "BOh12":
                case "BOh13":
                case "BOh14":
                case "BOh15":
                case "BOh16":
                case "BOh17":
                case "BOh18":
                case "BOh19":
                case "BOh20":
                case "BOh21":
                case "BOh22":
                case "BOh23":
                case "BOh24":
                case "BOh25":
                case "BOh26":
                case "BOh27":
                case "BOh28":
                case "BOh29":
                case "BOh30":
                case "BOh31":
                case "BOh32":
                case "BOh33":
                case "BOh34":
                case "BOh35":
                case "BOh36":
                case "BOh37":
                case "BOh38":
                case "BOh39":
                case "BOh40":
                case "BOh41":
                case "BOh42":
                case "BOh43":
                case "BOh44":
                case "BOh45":
                case "BOh46":
                case "BOh47":
                case "BOh48":
                case "BOh49":
                case "BOh50":
                case "BOh51":
                case "BOh52":
                case "BOh53":
                case "BOh54":
                case "BOh55":
                case "BOh56":
                case "BOh57":
                case "BOh58":
                case "BOh59":
                case "BOh60":
                case "BOh61":
                case "BOh62":
                case "BOh63":
                case "BOh64":
                case "BOh65":
                case "BOh66":
                case "BOh67":
                case "BOh68":
                case "BOh69":
                case "BOh70":
                case "BOh71":
                case "BOh72":
                case "BOh73":
                case "BOh74":
                case "BOh75":
                case "BOh76":
                case "BOh77":
                case "BOh78":
                case "BOh79":
                case "BOh80":
                case "BOh81":
                case "BOh82":
                case "BOh83":
                case "BOh84":
                    result = "BOh"; break;
                case "FD1":
                case "FD2":
                case "FD3":
                case "FD4":
                case "FD5":
                case "FD6":
                case "FD7":
                case "FD8":
                case "FD9":
                case "FD10":
                case "FD11":
                case "FD12":
                case "FD13":
                case "FD14":
                case "FD15":
                case "FD16":
                case "FD17":
                case "FD18":
                case "FD19":
                case "FD20":
                case "FD21":
                case "FD22":
                case "FD23":
                case "FD24":
                case "FD25":
                case "FD26":
                case "FD27":
                case "FD28":
                case "FD29":
                case "FD30":
                case "FD31":
                case "FD32":
                case "FD33":
                case "FD34":
                case "FD35":
                case "FD36":
                case "FD37":
                case "FD38":
                case "FD39":
                case "FD40":
                case "FD41":
                case "FD42":
                case "FD43":
                case "FD44":
                case "FD45":
                case "FD46":
                case "FD47":
                case "FD48":
                case "FD49":
                case "FD50":
                case "FD51":
                case "FD52":
                case "FD53":
                case "FD54":
                case "FD55":
                case "FD56":
                case "FD57":
                case "FD58":
                case "FD59":
                case "FD60":
                case "FD61":
                case "FD62":
                case "FD63":
                case "FD64":
                case "FD65":
                case "FD66":
                case "FD67":
                case "FD68":
                case "FD69":
                case "FD70":
                case "FD71":
                case "FD72":
                    result = "FD"; break;
                case "BD1":
                case "BD2":
                case "BD3":
                case "BD4":
                case "BD5":
                case "BD6":
                case "BD7":
                case "BD8":
                case "BD9":
                case "BD10":
                case "BD11":
                case "BD12":
                case "BD13":
                case "BD14":
                case "BD15":
                case "BD16":
                case "BD17":
                case "BD18":
                case "BD19":
                case "BD20":
                case "BD21":
                case "BD22":
                case "BD23":
                case "BD24":
                case "BD25":
                case "BD26":
                case "BD27":
                case "BD28":
                case "BD29":
                case "BD30":
                case "BD31":
                case "BD32":
                case "BD33":
                case "BD34":
                case "BD35":
                case "BD36":
                case "BD37":
                case "BD38":
                case "BD39":
                case "BD40":
                case "BD41":
                case "BD42":
                case "BD43":
                case "BD44":
                case "BD45":
                case "BD46":
                case "BD47":
                case "BD48":
                case "BD49":
                case "BD50":
                case "BD51":
                case "BD52":
                case "BD53":
                case "BD54":
                case "BD55":
                case "BD56":
                case "BD57":
                case "BD58":
                case "BD59":
                case "BD60":
                case "BD61":
                case "BD62":
                case "BD63":
                case "BD64":
                case "BD65":
                case "BD66":
                case "BD67":
                case "BD68":
                case "BD69":
                case "BD70":
                case "BD71":
                case "BD72":
                    result = "BD"; break;
                case "FS1":
                case "FS2":
                case "FS3":
                case "FS4":
                case "FS5":
                case "FS6":
                case "FS7":
                case "FS8":
                case "FS9":
                case "FS10":
                case "FS11":
                case "FS12":
                case "FS13":
                case "FS14":
                case "FS15":
                case "FS16":
                case "FS17":
                case "FS18":
                case "FS19":
                case "FS20":
                case "FS21":
                case "FS22":
                case "FS23":
                case "FS24":
                case "FS25":
                case "FS26":
                case "FS27":
                case "FS28":
                case "FS29":
                case "FS30":
                case "FS31":
                case "FS32":
                case "FS33":
                case "FS34":
                case "FS35":
                case "FS36":
                case "FS37":
                case "FS38":
                case "FS39":
                case "FS40":
                case "FS41":
                case "FS42":
                case "FS43":
                case "FS44":
                case "FS45":
                case "FS46":
                case "FS47":
                case "FS48":
                case "FS49":
                case "FS50":
                case "FS51":
                case "FS52":
                case "FS53":
                case "FS54":
                case "FS55":
                case "FS56":
                case "FS57":
                case "FS58":
                case "FS59":
                case "FS60":
                case "FS61":
                case "FS62":
                case "FS63":
                case "FS64":
                case "FS65":
                case "FS66":
                case "FS67":
                case "FS68":
                case "FS69":
                case "FS70":
                case "FS71":
                case "FS72":
                    result = "FS"; break;
                case "BS1":
                case "BS2":
                case "BS3":
                case "BS4":
                case "BS5":
                case "BS6":
                case "BS7":
                case "BS8":
                case "BS9":
                case "BS10":
                case "BS11":
                case "BS12":
                case "BS13":
                case "BS14":
                case "BS15":
                case "BS16":
                case "BS17":
                case "BS18":
                case "BS19":
                case "BS20":
                case "BS21":
                case "BS22":
                case "BS23":
                case "BS24":
                case "BS25":
                case "BS26":
                case "BS27":
                case "BS28":
                case "BS29":
                case "BS30":
                case "BS31":
                case "BS32":
                case "BS33":
                case "BS34":
                case "BS35":
                case "BS36":
                case "BS37":
                case "BS38":
                case "BS39":
                case "BS40":
                case "BS41":
                case "BS42":
                case "BS43":
                case "BS44":
                case "BS45":
                case "BS46":
                case "BS47":
                case "BS48":
                case "BS49":
                case "BS50":
                case "BS51":
                case "BS52":
                case "BS53":
                case "BS54":
                case "BS55":
                case "BS56":
                case "BS57":
                case "BS58":
                case "BS59":
                case "BS60":
                case "BS61":
                case "BS62":
                case "BS63":
                case "BS64":
                case "BS65":
                case "BS66":
                case "BS67":
                case "BS68":
                case "BS69":
                case "BS70":
                case "BS71":
                case "BS72":
                    result = "BS"; break;
                default: result = content; break;
            }
            return result;
        }
    }
}
